package com.sky.financelake.viewmodels;

import android.content.Context;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;

import com.google.android.material.snackbar.Snackbar;
import com.sky.financelake.R;

/**
 * abstract base class for ViewModels
 */
public abstract class BaseViewModel extends ViewModel {

    protected final String TAG = this.getClass().getCanonicalName();

    /**
     * Display snack bar
     *
     * @param context   Activity context
     * @param container Coordinator layout
     * @param message   Message
     * @param duration  Snack bar duration
     */
    public void displayShortSnackBar(@NonNull final Context context, @NonNull final View container, @NonNull final String message) {
        Snackbar.make(container, message, Snackbar.LENGTH_SHORT)
                .setActionTextColor(context.getResources().getColor(R.color.purple_200))
                .show();
    }

    /**
     * Display snack bar
     *
     * @param context   Activity context
     * @param container Coordinator layout
     * @param message   Message
     * @param duration  Snack bar duration
     */
    public void displayLongSnackBar(@NonNull final Context context, @NonNull final View container, @NonNull final String message) {
        Snackbar.make(container, message, Snackbar.LENGTH_LONG)
                .setActionTextColor(context.getResources().getColor(R.color.purple_200))
                .show();
    }


}
